import React from 'react';
import BusinessCenterOutlined from '@material-ui/icons/BusinessCenterOutlined';
import { NavView, get_mod, loc, NavListSub } from 'sui';
import { TechView } from './tech/view';
import { StepView } from './step';

const model = (cfg) => {
    const fix = [
        {uid: "tool.tech", view: TechView,  value: loc("l_144")},
        {uid: "tool.step", view: StepView,  value: loc("l_149")},
    ];

    return get_mod(cfg, fix, "tool");
};

const Tool = ({ mod, sideopen, cfg }) => <NavView cfg={cfg} model={model(cfg)} mod={mod} sideopen={sideopen} name="tool"/>;

const NavTool = (props) => <NavListSub icon={<BusinessCenterOutlined/>} sub={model(props.cfg)} {...props} scut={15}/>;

export {NavTool, Tool};
